package com.tool.aspect.controller;

import com.tool.aspect.AspectHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 酒徒
 * @Version 1.0
 * @data 2025/4/14 18:57
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @AspectHandler(value = "练习时长两年半，我是ikun")
    @GetMapping("/test")
    public String test(){
        return "before 测试";
    }

    @GetMapping("/test2")
    public String test2(){
        return "after 测试";
    }

    @GetMapping("/test3")
    public Integer around(){
        System.out.println("around 执行中。。。");
        return 250;
    }

    @GetMapping("/test4")
    public Integer add(Integer a, Integer b){
        return a + b;
    }

    @GetMapping("/test5")
    public Integer exception(Integer a, Integer b){
        return a / b;
    }
}
